package tothreedesignmodel.observer;

/**
 * @author lzhphantom
 * @description
 * @date 创建于 22:37 2020/8/1
 * @modified
 */
public class ConcreteSubject extends AbstractSubject {
    @Override
    public void notifyObserver() {
        observers.forEach(Observer::response);
    }

    public static void main(String[] args) {
        ConcreteSubject subject = new ConcreteSubject();
        Student student = new Student("tom");
        Teacher teacher = new Teacher();
        subject.add(student);
        subject.add(teacher);
        subject.notifyObserver();
    }
}
